import axios from "axios"
import { Toast } from "antd-mobile"
const instance = axios.create({
  baseURL: 'https://www.linweiqin.cn/api/public/v1/',
});
// 请求的拦截
instance.interceptors.request.use(function (config) {
  Toast.loading('正在加载...', 0, () => {});
  return config;
}, function (error) {
  return Promise.reject(error);
});

// 响应的拦截
instance.interceptors.response.use(function (response) {
  setTimeout(() => {
    Toast.hide();
  }, 2000);
  return response.data.message;
}, function (error) {
  return Promise.reject(error);
});

export default instance